import request from '@/utils/request.js'

// 权限请求数据
export const gitpermissions = (params) => {
  return request({
    method: 'GET',
    url: '/permissions',
    params
  })
}

// 新增权限
export const addpermissions = (data) => {
  return request({
    method: 'POST',
    url: '/permissions',
    data
  })
}

// 权限简单列表
// export const simplepermissions = params => {
//   return request({
//     method: 'GET',
//     url: '//permissions/simple',
//     params
//   })
// }

// 菜单列表请求
export const getChaiDanLieBiao = () => {
  return request({
    method: 'GET',
    url: '/menus'
  })
}
//  获取权限详情
export const detail = (data) => {
  return request({
    url: `/permissions/${data.id}`,
    method: 'GET',
    data
  })
}

// 删除权限
export const remove = (id) => {
  return request({
    method: 'DELETE',
    url: `/permissions/${id}`
  })
}

// 修改权限
export const change = (data) => {
  return request({
    method: 'PUT',
    url: `/permissions/${data.id}`,
    data
  })
}
